<!-- 基础：3、模板语法 缩写 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>基础：3、模板语法 缩写</title>
	<script type="text/javascript" src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>	
	<div class="app">
		<!-- v-bind缩写 -->	
		<!-- 完整语法 -->
		<a v-bind:href="url" target="_blank">百度</a>

		<!-- 缩写 -->
		<a :href="url" target="_blank">百度</a>

		<!-- v-on缩写 -->
		<!-- 完整语法 -->
		<button v-on:click="doSomething">点击测试</button>

		<!-- 缩写 -->
		<button @click="doSomething">点击测试</button>
	</div>

	<script type="text/javascript">
		var app = new Vue({
			el: '.app',
			data: {
				url: 'http://www.baidu.com'
			},
			methods: {
				doSomething: function(){
					alert('test success');
				}
			}
		})
	</script>
</body>
</html>
<!-- 代码均通过测试，有什么纰漏欢迎联系 QQ:1123176978  Wechat:hyhlovehuanong -->